import math

def calculate_yaw(x1, y1, x2, y2):
    dx = x2 - x1
    dy = y2 - y1
    yaw = math.atan2(dx, dy)
    return yaw


# 假设当前位置和目标位置坐标信息
current_x = 0.0
current_y = 0.0
target_x = 1.0
target_y = -1.0

# 计算目标的yaw角
target_yaw = calculate_yaw(current_x, current_y, target_x, target_y)

# 打印结果（以弧度为单位）
print("目标的yaw角（弧度）:", target_yaw)


# 转换为角度值
target_yaw_deg = math.degrees(target_yaw)

# 打印结果（以角度为单位）
print("目标的yaw角（角度）:", target_yaw_deg)
